package com.itheima.test;

import lombok.Data;

public class JobTest3 {
    public static void main(String[] args) {
        Student student = new Student();
        try {
            studentSetSex(student);
        } catch (SexInputException | AgeInputException a) {
            a.printStackTrace();
        }
    }

    static void studentSetSex(Student student) {
        student.setSex("sss");
        if (student.getSex().equals("男") || student.getSex().equals("女")) {
            System.out.println("性别正确");
        } else {
            throw new SexInputException("性别异常");
        }
        System.out.println("12123123123");
        student.setAge(100);
        if (student.getAge() > 0 && student.getAge() < 100) {
            System.out.println("年龄正常");
        } else {
            throw new AgeInputException("年龄异常");
        }
    }
}


